Repository navigation
Do not update status on unpopulated CR when Get fails - #3279
AyushSrivastava1818 wants to merge 1 commit into
Conversation
When r.Get fails with a non-404 error, ClusterPolicyReconciler and
NVIDIADriverReconciler attempt to set conditions on an unpopulated
instance where .metadata.name is empty. This causes a secondary error
("resource name may not be empty") and masks the underlying failure.
Align with GPUClusterReconciler by logging the error and returning it
directly for requeue without updating status on the unpopulated CR.
Signed-off-by: AyushSrivastava1818 <ayush.sri0705@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Low Merge Risk:
|
Issue
Fixes #3190
Description
When
.Get fails with a non-404 error (such as transient API server connection issues, context timeouts, or client rate limiting), ClusterPolicyReconciler and NVIDIADriverReconciler previously called
.conditionUpdater.SetConditionsError on an unpopulated custom resource object whose .metadata.name is empty ("").
Because SetConditionsError attempts to fetch the CR by name ( ypes.NamespacedName{Name: cr.Name}), this triggered a secondary error:
failed to get <CR> instance for status update: resource name may not be emptywhich obscured the original Get failure and polluted controller logs.
This PR aligns both reconcilers with the pattern already established in GPUClusterReconciler: when
.Get fails on an unpopulated instance, log the error and surface it directly for requeue without attempting to set conditions on an empty CR.
Checklist
Testing
.Get errors are returned directly without invoking SetConditionsError.